<script type="text/javascript">
$(function(){
	var str = "";
$("#tab").html("");
$.get(
	"shop/slide-class-list.s",
	function(data){
		$.each(data, function (i, item) {
            str+="<tr>";
            str+="<td >"+item.shopSlideId+"</th>";
            str+="<td >"+item.shopSlideName+"</th>";
            str+="<td >"+item.shopSlidePicture+"</th>";
            str+="<td >"+item.shopSlideUrl+"</th>";
            str+=`<td ><button type='button' data-shopSlideId=`+item.shopSlideId+` data-shopSlideName=`+item.shopSlideName+` data-shopSlidePicture=`+item.shopSlidePicture+` data-shopSlideUrl=`+item.shopSlideUrl+` class='btn btn-success btn-xs btnxg' data-toggle='modal' data-target='.bs-example-modal-lg'>修改</button></th>`;
            str+="</tr>";
        });
        $("#tab").append(str);
	},"json"
);
$("#tab").on("click", "button.btnxg", function() {
	//console.info($("input[name='img']"))
	
	$("#shopSlideId").val($(this).data('shopslideid'));
	$("#imgShow").attr('src',$(this).data('shopslidepicture'));
	$("#shopSlideName").val($(this).data('shopslidename'));
	$("#shopSlideUrl").val($(this).data('shopslideurl'));
});
});
</script>
<table class="table table-bordered text-center "  >
	<thead>
		<tr style="font-weight:bold">
	        <td>编号</th>
	        <td >幻灯片名称</th>
	        <td>幻灯图片</th>
	        <td>链接</th>
	        <td>操作</th>
      	</tr>
	</thead>
	<tbody id="tab">
    	
	</tbody>
</table>

<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
	    <div class="panel panel-primary">
	      <div class="panel-heading">
	        <h3 class="panel-title">商城轮播图修改</h3>
	      </div>
	      <div class="panel-body">
	        <div role="tabpanel" class="tab-pane active" id="profile">
						<div class="col-sm-6">
							<form action="shop/slide-photo.do" method="post" enctype="multipart/form-data" class="form-horizontal _uploadForm" style="padding-top: 1em;">
								<div class="form-group">
									<label class="col-sm-2 control-label">编号</label>
									<div class="col-sm-10">
										<input type="text" class="form-control input-sm" placeholder="编号" id="shopSlideId" name="shopSlideId" readonly>
									</div>
								</div>

								<div class="form-group" id="_bntimg">
									<label class="col-sm-2 control-label">相片</label>
									<div class="col-sm-10">
										<input accept="image/*" class="hidden" type="file" name="img" required="required" />
										<button type="button" class="btn btn-danger _img"><i class="fa fa-image"></i> 选择图片</button>
									</div>
								</div>

								

								<div class="form-group">
									<label class="col-sm-2 control-label">名称</label>
									<div class="col-sm-10">
										<input class="form-control" id="shopSlideName" name="shopSlideName" type="text" placeholder="请输入幻灯片名称" />
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label">链接</label>
									<div class="col-sm-10">
										<input class="form-control" id="shopSlideUrl" name="shopSlideUrl" type="text" placeholder="请输链接名称" />
									</div>
								</div>
								<div class="form-group">

									<div class="col-sm-10 col-sm-offset-2">
										<button type="submit" class="btn btn-default">修改</button>
									</div>
								</div>

							</form>

						</div>
						<div class="col-sm-6">
							<img id="imgShow" style="max-width: 300px; max-height: 300px; margin-top: 1em;" src="img/_noimg.png" class="img-thumbnail" />
							<div class="progress" style="display: none; margin-top: 1em;">
								<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%">
								</div>
							</div>
						</div>
					</div>
				</div>
	      </div>
	    </div>
    </div>
  </div>
</div>